#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 1e5 + 5;

int n, m;
int a[N];
int b[N];
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  rep(i, 1, n) cin >> a[i];
  rep(i, 1, n) b[i] = a[i] - a[i - 1];
  ll s1 = 0, s2 = 0;
  rep(i, 2, n) {
    if (b[i] > 0)
      s1 += b[i];
    else
      s2 -= b[i];
  }
  cout << max(s1, s2) << endl;
  cout << 1 + abs(s1 - s2);
  return 0;
}